/*
 * @Description:路由
 * @Version: 2.0
 * @Autor: kafei
 * @Date: 2021-11-18 11:22:09
 * @LastEditors: kafei
 * @LastEditTime: 2021-12-22 10:28:47
 */
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

export const constantRoutes = [
  // {
  //   path: '/dashboard',
  //   component: () => import('@/views/dashboard/index.vue')
  // },
  {
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      title: '登录',
      cilentType: '0'
    }
  }
  // {
  //   path:"/sub02/about",
  //   component: (resolve) => require(['@/components/otherSystem/index.vue'], resolve)
  // },
  // {
  //   path:"/sub02",
  //   component: () => import('@/components/otherSystem/index.vue')
  // },
  //  {
  //   path: '/dashboard',
  //   component: () => import('@/views/dashboard/index.vue')
  // },
]
const createRouter = () => new Router({
  mode: 'history',
  routes: constantRoutes
})

const router = createRouter()

// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter () {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router
